package com.cbb.display.service.impl;

import com.cbb.display.entity.SaleTarget;
import com.cbb.display.dao.SaleTargetMapper;
import com.cbb.display.service.SaleTargetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bigbomb
 * @since 2020-03-12
 */
@Service
public class SaleTargetServiceImpl extends ServiceImpl<SaleTargetMapper, SaleTarget> implements SaleTargetService {

	@Override
	public boolean addSaleTarget(List<SaleTarget> noidcollection, List<SaleTarget> idcollection) {
		// TODO Auto-generated method stub
		boolean status = false;
		try {
			if(noidcollection.size()>0)
		    {
		    	status = super.saveBatch(noidcollection);
		    }
			if(idcollection.size()>0)
			{
				status = super.updateBatchById(idcollection);
			}
			return status;
		}catch (RuntimeException e) {
			// TODO: handle exception
			status = false;
			return status;
		}
	}

}
